package com.bll.impl.Activity_user;

import java.util.List;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import com.bean.ActivityBean;
import com.bean.ActivityUserBean;
import com.bll.Action;
import com.dao.ActivityDao;
import com.dao.ActivityUserDao;

public class AddActivity_userAction implements Action{
	public String execute(HttpServletRequest request,HttpServletResponse response) {
		
		String name=request.getParameter("name");
		//System.out.println("activityTime:"+activityTime);
		String tel=request.getParameter("tel");
		//System.out.println("address:"+address);
		int userId=Integer.parseInt(request.getSession().getAttribute("userId").toString());
		System.out.println("activityId:"+request.getParameter("id"));
		int activityId=Integer.parseInt(request.getParameter("id").toString());
		//String lujing=request.getParameter("lujing");
		ActivityUserDao dao=new ActivityUserDao();
		ActivityUserBean bean=new ActivityUserBean();
		bean.setName(name);
		bean.setTel(tel);
		bean.setUserId(userId);
		bean.setActivityId(activityId);
		
		int n=dao.addActivityUser(bean);
		if(n>0){
			return "ShowActivity_user.a_user?lujing="+request.getParameter("lujing1");
		}
		return "false";
	}
}

